import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 点检记录明细信息 */
export interface EquipmentCheckRecordDetail {
          id: number; // id
          recordId?: number; // 点检记录id
          checkItemId: number; // 点检项id
          files: string; // 附件
          fileName: string; // 附件名称
          remark: string; // 备注
  }

// 点检记录明细 API
export const EquipmentCheckRecordDetailApi = {
  // 查询点检记录明细分页
  getEquipmentCheckRecordDetailPage: async (params: any) => {
    return await request.get({ url: `/business/equipment-check-record-detail/page`, params })
  },

  // 查询点检记录明细详情
  getEquipmentCheckRecordDetail: async (id: number) => {
    return await request.get({ url: `/business/equipment-check-record-detail/get?id=` + id })
  },

  // 新增点检记录明细
  createEquipmentCheckRecordDetail: async (data: EquipmentCheckRecordDetail) => {
    return await request.post({ url: `/business/equipment-check-record-detail/create`, data })
  },

  // 修改点检记录明细
  updateEquipmentCheckRecordDetail: async (data: EquipmentCheckRecordDetail) => {
    return await request.put({ url: `/business/equipment-check-record-detail/update`, data })
  },

  // 删除点检记录明细
  deleteEquipmentCheckRecordDetail: async (id: number) => {
    return await request.delete({ url: `/business/equipment-check-record-detail/delete?id=` + id })
  },

  /** 批量删除点检记录明细 */
  deleteEquipmentCheckRecordDetailList: async (ids: number[]) => {
    return await request.delete({ url: `/business/equipment-check-record-detail/delete-list?ids=${ids.join(',')}` })
  },

  // 导出点检记录明细 Excel
  exportEquipmentCheckRecordDetail: async (params) => {
    return await request.download({ url: `/business/equipment-check-record-detail/export-excel`, params })
  }
}